{include file="public:header" /}
<!--管理员管理-->
<div class="pad_lr_10">
    <div class="J_tablelist table_list" data-acturi="{:url('Admin/ajaxEdit')}">
        <table width="100%" cellspacing="0">
            <thead>
            <tr>
                <th width="40"><input type="checkbox" name="checkall" class="J_checkall"></th>
                <th width="40">ID</th>
                <th>名称</th>
                <th>角色</th>
                <th>最后登录时间</th>
      			<th>最后登录IP</th>
                <th>状态</th>
                <th width=100>操作</th>
            </tr>
            </thead>
    	    <tbody>
            {volist name="list" id="val"}
            <tr>
                <td align="center"><input type="checkbox" class="J_checkitem" value="{$val.id}"></td>
                <td align="center">{$val.id}</td>
                <td align="center"> {if condition="$val['role_id'] neq $roleid and $roleid neq $superroleid"}{$val.username}{else /}<span data-tdtype="edit" data-field="username" class="tdedit" data-id="{$val.id}">{$val.username}</span>{/if}</td>
                <td align="center">
                {$val['role']['title']}
				</td>
                <td align="center">{$val.last_time|date='Y-m-d H:i:s',###}</td>
                <td align="center">{$val.last_ip}</td>
                <td align="center">
                    <img data-tdtype="toggle" data-field="status" data-id="{$val.id}" data-value="{$val.status}" src="__IMG__/toggle_{if condition="$val.status eq 0"}disabled{else/}enabled{/if}.gif" />
                </td>
                <td align="center">
                    {if condition="$val['role_id'] neq $roleid and $roleid neq $superroleid"}无权限{else /}
                        <a href="javascript:;" class="J_showdialog" data-uri="{:url('Admin/edit',['id'=>$val['id']])}" data-title="编辑 - {$val.username}"  data-id="edit" data-width="450" data-height="210">编辑</a> |

                    {/if}
                    {if condition="$val['role_id'] lt session('adminInfo.role') or $val['id'] eq session('adminInfo.id')"}
                        无权限
                        {else /}
                        <a href="javascript:;" class="J_confirmurl" data-acttype="ajax" data-uri="{:url('Admin/delete', ['id'=>$val['id']])}" data-msg="{:sprintf('确定删除用户%s么?',$val['username'])}">删除</a>
                    {/if}
                    </td>
            </tr>
            {/volist}
    	   </tbody>
        </table>
    </div>
    <div class="btn_wrap_fixed">
		<label class="select_all mr10"><input type="checkbox" name="checkall" class="J_checkall">全选/取消</label>
		<input type="button" class="btn" data-tdtype="batch_action" data-acttype="ajax" data-uri="{:url('Admin/delete')}" data-name="id" data-msg="确定删除所选项么？" value="删除" />
		<div id="pages">{$pages}</div>
    </div>
</div>
{include file="public:footer" /}
</body>
</html>